/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.s2aei.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Christian
 */
@Entity
@Table(name = "Lideres")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Lideres.findAll", query = "SELECT l FROM Lideres l"),
    @NamedQuery(name = "Lideres.findByIdLider", query = "SELECT l FROM Lideres l WHERE l.idLider = :idLider")})
public class Lideres implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idLider")
    private Integer idLider;
    @JoinColumn(name = "idLider", referencedColumnName = "aluno_Id", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Aluno aluno;
    @JoinColumn(name = "projeto", referencedColumnName = "idProjeto")
    @OneToOne(optional = false)
    private Projeto projeto;

    public Lideres() {
    }

    public Lideres(Integer idLider) {
        this.idLider = idLider;
    }

    public Integer getIdLider() {
        return idLider;
    }

    public void setIdLider(Integer idLider) {
        this.idLider = idLider;
    }

    public Aluno getAluno() {
        return aluno;
    }

    public void setAluno(Aluno aluno) {
        this.aluno = aluno;
    }

    public Projeto getProjeto() {
        return projeto;
    }

    public void setProjeto(Projeto projeto) {
        this.projeto = projeto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLider != null ? idLider.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Lideres)) {
            return false;
        }
        Lideres other = (Lideres) object;
        if ((this.idLider == null && other.idLider != null) || (this.idLider != null && !this.idLider.equals(other.idLider))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.s2aei.model.Lideres[ idLider=" + idLider + " ]";
    }
    
}
